<?php
// +----------------------------------------------------------------------
// | snake
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 http://baiyf.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: NickBai <1902822973@qq.com>
// +----------------------------------------------------------------------
namespace app\api\model;

use think\Model;

class BlacklistModel extends Model
{
    // 确定链接表名
    protected $table = 'xl_blacklist';

    /**
     * live_shop链接查询
     * @param $where
     * @param $offset
     * @param $limit
     */
    public function getBlacklistByWhere($where, $offset, $limit)
    {
        return $this->field($this->table . '.*,xl_shop.shop_name,head_img')
            ->join('xl_shop', $this->table . '.shop_id = ' . 'xl_shop.id')
            ->where($where)->limit($offset, $limit)->order('id desc')->select();
    }
    //取消拉黑
  public function delBlacklist($id){
    try{

            $this->where('id', $id)->delete();
            return msg(1, '', '取消成功');

        }catch(\Exception $e){
            return msg(-1, '', $e->getMessage());
        }
  }

}